/**
 * The direction codes from the Rovio API specification.
 */
enum Direction {
    DIR_STOP = 0,
    DIR_FORWARD,
    DIR_BACKWARD,
    DIR_LEFT,
    DIR_RIGHT,
    DIR_ROT_LEFT,
    DIR_ROT_RIGHT,
    DIR_DIAG_FOR_LEFT,
    DIR_DIAG_FOR_RIGHT,
    DIR_DIAG_BACK_LEFT,
    DIR_DIAG_BACK_RIGHT,
    HEAD_UP,
    HEAD_DOWN,
    HEAD_MIDDLE
};

/**
 * Some helpful speed values from the Rovio API specification.
 */
enum Speed {
    SPEED_FASTEST = 1,
    SPEED_MEDIUM = 5,
    SPEED_SLOWEST = 10
};

/**
 * Executes a single drive command.
 *
 * @param curl The CURL object to operate on
 * @param url The URL of the Rovio host
 * @param dir A direction from the Direction enum
 * @param speed 1 for fastest, 10 for slowest
 */
CURLcode drive(CURL *curl, std::string url, Direction dir, int speed);

/**
 * Drives a robot at the specified speed for a certain amount of time, then
 * pauses.
 *
 * @param curl The CURL object to operate on
 * @param url The URL of the Rovio host
 * @param dir A direction from the Direction enum
 * @param speed 1 for fastest, 10 for slowest
 * @param move The duration for which to drive, in milliseconds
 * @param sleep The duration for which to sleep, in milliseconds
 */
void drive(CURL *curl, std::string url, Direction dir, int speed, int move, int pause = 1000);
